import httpInstance from "@/utils/http.js";

// prompt相关相关api

// 新建
export const addPromptAPI = (addPromptObject) => {
    return httpInstance({
        url: "/prompt/add",
        method: "POST",
        data: addPromptObject
    })
}


// 修改
export const modifyPromptAPI = (modifyObject) => {
    /*
    js接收一个modify对象：
    {
        prompt_id: prompt_id,
        prompt_name: prompt_name,
        prompt_content: prompt_content
    }
     */
    return httpInstance({
        url: "/prompt/modify",
        method: "POST",
        data: modifyObject
    })
}


// 删除
export const delPromptAPI = (delPromptId) => {
    return httpInstance({
        url:"/prompt/del",
        method: "POST",
        data: {
            prompt_id: delPromptId
        }
    })
}


// 查询全部
export const listPromptAPI = () => {
    return httpInstance({
        url: "/prompt/list",
        method: "POST"
    })
}

// 查单个
export const detailPromptAPI = (prompt_id) => {
    return httpInstance({
        url: "/prompt/detail",
        method: "POST",
        data: {
            prompt_id: prompt_id
        }
    })
}